#include <bits/stdc++.h>
#define rep(a, b, c) for(a = b; a <= c; ++a)
#define ll long long
using namespace std;
void chmax(int &x, int y){x = max(x, y);}
void chmin(int &x, int y){x = min(x, y);}

const int N = 1e5 + 5;
int n, i, m, j, k, lst, ans, sum;
int a[N], b[N];

int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin.tie();
    cout.tie();
    ios::sync_with_stdio(0);
    cin >> n;
    ans = n;
    rep(i, 1, n){
        cin >> a[i];
        ++b[a[i]];
        chmax(m, a[i]);
    }
    sort(a + 1, a + n + 1);
    int m = unique(a + 1, a + n + 1) - a - 1;
    rep(j, 1, m){
        i = a[j];
        sum = 0;
        while(sum < b[i] && k != j){
            if(sum + b[lst] <= b[i]){
                ans -= b[lst];
                sum += b[lst];
                b[lst] = 0;
            }
            else{
                ans -= (b[i] - sum);
                b[lst] -= (b[i] - sum);
                sum = b[i];
            }
            if(!b[lst])lst = a[++k];
 //           cout << j << ' ' << ans << ' ' << lst << '\n';
        }
    }
    cout << ans << '\n';
    return 0;
}
